package edu.zut.software.identity.Repository;

import edu.zut.software.identity.domain.StuGrade;
import edu.zut.software.identity.domain.StuInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface StuInfoRepository  extends JpaRepository<StuInfo,Object>, JpaSpecificationExecutor<StuInfo> {
    @Query(value = "select *\n" +
            "    from student_info s\n" +
            "    where  s.college_name=?1",
            nativeQuery = true)
    List<StuInfo> getStuInfoByCollege(@Param("name") String name);
    @Query(value = "select *\n" +
            "    from student_info s\n" +
            "    where  s.major_name=?1",
            nativeQuery = true)
    List<StuInfo> getStuInfoByMajor(@Param("name") String name);
}
